﻿using System;
using DapperExtensions.Mapper;
using Newtonsoft.Json;

namespace ZilLion.Service.WeChatMall.Domain.Entitys.GsInfo
{
    public class GsBasicInfoEntity
    {
        /// <summary>
        ///     cpk 货品id
        /// </summary>
        [JsonProperty("gsid")]
        public long GsId { get; set; }

        /// <summary>
        ///     纵联商城接入关键字
        /// </summary>
        [JsonProperty("zlcompanykey")]
        public string ZlCompanyKey { get; set; }

        /// <summary>
        ///     品名
        /// </summary>
        [JsonProperty("gsname")]
        public string GsName { get; set; }

        /// <summary>
        ///     货品售价
        /// </summary>
        [JsonProperty("gsprice")]
        public decimal GsPrice { get; set; }

        /// <summary>
        ///     货品备注
        /// </summary>
        [JsonProperty("gsdescription")]
        public string GsDescription { get; set; }

        /// <summary>
        ///     货品介绍文案
        /// </summary>

        [JsonProperty("gsinfo")]
        public string GsInfo { get; set; }

        /// <summary>
        ///     货品图标名称
        /// </summary>
        [JsonProperty("gsicon")]
        public string GsIcon { get; set; }

        /// <summary>
        ///     货品图片地址
        /// </summary>
        [JsonProperty("gsimage")]
        public string GsImage { get; set; }

        /// <summary>
        ///     修改时间
        /// </summary>
        [JsonProperty("updatedtime")]
        public DateTime UpdatedTime { get; set; }

        /// <summary>
        ///     修改人
        /// </summary>
        [JsonProperty("updater")]
        public long Updater { get; set; }
    }

    public class GsBasicInfoEntityMapper : ClassMapper<GsBasicInfoEntity>
    {
        public GsBasicInfoEntityMapper()
        {
            Table("gsbasicinfo");
            Map(f => f.GsId).Column("gsid").Key(KeyType.Assigned);
            Map(f => f.ZlCompanyKey).Column("zlcompanykey");
            Map(f => f.GsName).Column("gsname");
            Map(f => f.GsPrice).Column("gsprice");
            Map(f => f.GsDescription).Column("gsdescription");
            Map(f => f.GsInfo).Column("gsinfo");
            Map(f => f.GsIcon).Column("gsicon");
            Map(f => f.GsImage).Column("gsimage");
            Map(f => f.UpdatedTime).Column("updatedtime");
            Map(f => f.Updater).Column("updater");
        }
    }
}